<?php

namespace app\admin\controller;

use think\Controller;

class Login extends Controller
{
    public function login(){
        if(request()->isPost()){
            $admin=input('param.');
            if($admin['user']=="admin" && $admin['password']=="000000sgt"){
                session('admin',$admin);
                return $this->redirect('admin/index/index');
            }
        }else{
            if(session('admin')){
                return $this->redirect('admin/index/index');
            }
            return $this->fetch();
        }

    }
}
